package com.cap.bts.crmdp.dealer.purchase.domain;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.cap.bts.crmdp.dealer.card.domain.CardDefinition;
import com.cap.bts.framework.common.domain.BaseDomain;


/**
 * The persistent class for the tm_crm_package_definition database table.
 * 
 */
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name="TM_CRM_PACKAGE_DEFINITION")
@AttributeOverrides({
    @AttributeOverride(name="createBy", column=@Column(name="CREATE_BY")),
    @AttributeOverride(name="createDate", column=@Column(name="CREATE_DATE", nullable = false)),
    @AttributeOverride(name="lastUpdateBy", column=@Column(name="LAST_UPDATE_BY")),
    @AttributeOverride(name="lastUpdateDate", column=@Column(name="LAST_UPDATE_DATE"))
})
public class PackageDefinition extends BaseDomain implements Serializable {
	
    /**
     * 
     */
    private static final long serialVersionUID = -8670383459147298796L;
    
    private Long id;

    private String code;

    private String description;

    private Integer isPhysicalCard;

    private Integer isPrepaymentCard;

    private String name;

    private Double price;

    private Byte status;

    private String unitOfPeriod;

    private Integer validPeriod;
    
    private Long numberSequence;
    
    private CardDefinition cardDefinition;
    
    private int sequenceNumber;

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    @Column(name="IS_PHYSICAL_CARD")
    public Integer getIsPhysicalCard() {
        return this.isPhysicalCard;
    }

    public void setIsPhysicalCard(Integer isPhysicalCard) {
        this.isPhysicalCard = isPhysicalCard;
    }

    @Column(name="IS_PREPAYMENT_CARD")
    public Integer getIsPrepaymentCard() {
        return this.isPrepaymentCard;
    }

    public void setIsPrepaymentCard(Integer isPrepaymentCard) {
        this.isPrepaymentCard = isPrepaymentCard;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return this.price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Byte getStatus() {
        return this.status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    @Column(name="UNIT_OF_PERIOD")
    public String getUnitOfPeriod() {
        return this.unitOfPeriod;
    }

    public void setUnitOfPeriod(String unitOfPeriod) {
        this.unitOfPeriod = unitOfPeriod;
    }

    @Column(name="VALID_PERIOD")
    public Integer getValidPeriod() {
        return this.validPeriod;
    }

    public void setValidPeriod(Integer validPeriod) {
        this.validPeriod = validPeriod;
    }

    /**
     * @Date        :      Jul 27, 2015
     *
     * @return the numberSequence
     */
    @Column(name="NUMBER_SEQUENCE")
    public Long getNumberSequence() {
        return numberSequence;
    }

    /**
     * @Date        :      Jul 27, 2015
     *
     * @param numberSequence the numberSequence to set
     */
    public void setNumberSequence(Long numberSequence) {
        this.numberSequence = numberSequence;
    }
    
    /**
     * @Date        :      Aug 19, 2015
     *
     * @return the cardDefinition
     */
    @ManyToOne(targetEntity = CardDefinition.class)
    @JoinColumn(name = "CARD_DEF_ID", referencedColumnName = "ID")
    public CardDefinition getCardDefinition() {
        return cardDefinition;
    }

    /**
     * @Date        :      Aug 19, 2015
     *
     * @param cardDefinition the cardDefinition to set
     */
    public void setCardDefinition(CardDefinition cardDefinition) {
        this.cardDefinition = cardDefinition;
    }
    
    @Column(name="SEQUENCE_NUMBER")
	public int getSequenceNumber() {
		return sequenceNumber;
	}

	public void setSequenceNumber(int sequenceNumber) {
		this.sequenceNumber = sequenceNumber;
	}
    
    
}